<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
		<style>
			body {
				display: flex;
				justify-content: center;
				align-items: center;
			}

			.container {
				width: 200px;
				height: 200px;
				/* border: 2px solid black; */
				/* line-height: 100px; */
				position: relative;
				perspective: 300px;
			}

			.font,
			.back {
				width: 200px;
				height: 200px;
				font-size: 30px;
				color: azure;
				text-align: center;
				backface-visibility: hidden;
				position: absolute;
				left: 0;
				top: 0;
				transition-duration: 1000ms;
			}

			.font {
				background-color: red;
			}

			.back {
				background-color: #008c8c;
				transform: rotateY(180deg);
			}

			.container:hover .font {
				transform: rotateY(-180deg);
			}

			.container:hover .back {
				transform: rotateY(0deg);
			}
		</style>
	</head>

	<body>
		<div class="container">
			<div class="font">1</div>
			<div class="back">2</div>
		</div>
	</body>
</html>
